import request from "@/utils/request";
import requestVod from "@/utils/requestVod";
import { getPort } from "portfinder";
export default {
  //添加篇章章节
  saveChapter(addChapter) {
    return request({
      url: "/Learning/edu-chapter/save",
      method: "post",
      data: addChapter
    });
  },
  // 删篇章
  removeChapter(id) {
    return request({
      url: `/Learning/edu-chapter/remove/${id}`,
      method: "delete"
    });
  },
  // 根据id查篇章
  getOneChapter(id) {
    return request({
      url: `/Learning/edu-chapter/getOne/${id}`,
      method: "get"
    });
  },
  // 查询所有章节和小节（tree 模式传递过来）
  getTree(id) {
    return request({
      url: `/Learning/edu-chapter/getTree/${id}`,
      method: "get"
    });
  },
  // 增小节
  saveVideo(video) {
    return request({
      url: "/Learning/edu-video/save",
      method: "post",
      data: video
    });
  },
  // 删除小节视频
  DelectVideo(videoId) {
    return requestVod({
      url: "/aliyunvod/removeVideo/" + videoId,
      method: "delete"
    });
  }
};
